BASE = File.dirname(__FILE__) + '/../'

$LOAD_PATH << (File.dirname(__FILE__) + "/../core/")

module CcMonitor
  module BuildinActions
    def buildin
      true
    end
    
    def say(*opt)
      raise opt.join(' ')
    end
    
    def growl(*opt)
      raise opt.flatten.join(' : ')
    end
  end
end

class BuildStub
  attr_accessor :status, :message, :link, :committers, :name
  def initialize
    @name = 'build stub'
    @status = 'succeeded'
    @message = 'build message'
    @link = 'build link'
    @committers = 'build committers'
  end
end

require 'test/unit'
require 'cc_monitor'
require 'logger'

def logger
  logger = Logger.new(STDOUT)
  logger.level = Logger::UNKNOWN
  logger
end

module Test
  module Unit
    class TestCase
      def teardown
        begin
          CcMonitor::Repository.destroy
        rescue Exception => e
          puts "from teardown: #{e.message}"
        end
      end

      def assert_array(a, b)
        assert_equal a.length, b.length
        for i in 0..(a.length - 1)
          assert_equal(a[i], b[i])
        end
      end
    end
  end
end